notebook: Query the right node's padding
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Nov 2015 17:52:13 +0000 (18:52 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 6 Nov 2015 17:59:15 +0000 (18:59 +0100)
gtk/gtknotebook.c

index 52d3dd380035685548b3155cb891aac63826e18e..f7e5ff9a8e4627ccb9268c601ce744d155156648 100644 (file)
@@ -6176,10 +6176,11 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
            * see gtk_notebook_page_allocate().
            */
           gtk_style_context_save_to_node (context, page->cssnode);
+          gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &active_padding);
+          gtk_style_context_restore (context);
 
-          gtk_style_context_get_padding (context, GTK_STATE_FLAG_ACTIVE, &active_padding);
-          gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &normal_padding);
-
+          gtk_style_context_save_to_node (context, priv->cur_page->cssnode);
+          gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &active_padding);
           gtk_style_context_restore (context);
 
           padding.top = MAX (0, active_padding.top - normal_padding.top);